Skip to content

Add callbacks for when the Done button is tapped#643

Open
jsahoo wants to merge 1 commit intoTimOliver:mainfrom
jsahoo:didTapDone
Open

Add callbacks for when the Done button is tapped#643
jsahoo wants to merge 1 commit intoTimOliver:mainfrom
jsahoo:didTapDone

Conversation

@jsahoo
Copy link

@jsahoo jsahoo commented Mar 14, 2026

This PR adds a delegate method and completion handler that are called when the Done button is tapped. This is useful for displaying an activity indicator or HUD while the newly cropped image is being created (as this can sometimes take a second or two with large images), or for tracking button tap analytics.

Simulator Screen Recording

Example Usage (Delegate)

func cropViewControllerDidTapDone(_ cropViewController: CropViewController) {
    // show activity indicator
}

func cropViewController(_ cropViewController: CropViewController, didCropToImage image: UIImage, withRect cropRect: CGRect, angle: Int) {
    // hide activity indicator
}

Example Usage (Completion Handler)

cropViewController.onDidTapDone = {
    // show activity indicator
}

cropViewController.onDidCropToRect = { image, cropRect, angle in
    // hide activity indicator
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant